package com.myz.service.ribbon.controller;

import com.myz.service.ribbon.service.IRibbonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author maoyz
 */
@RestController
public class RibbonController {

    @Autowired
    private IRibbonService ribbonService;

    @RequestMapping("/rest")
    public String rest() {
        return ribbonService.rest();
    }

    @RequestMapping("/balance")
    public String balance() {
        return ribbonService.balance();
    }

    @RequestMapping(value = "/post", method = RequestMethod.POST)
    public String balance(@RequestParam("username") String username) {
        return ribbonService.post(username);
    }
}
